var ban = require('../memory/ban.memory');

module.exports={
    banOperation:banOperation
}

function banOperation(req,res,next) {
    var _id = req.params.id;
    var isBan = req.params.ban;
    console.log("_id:"+_id+",isBan:"+isBan);

    if(isBan=='true'){
        console.log("add");
        ban.addBanName(_id);
    }else{
        console.log('remove');
        ban.removeBanName(_id);
    }
    for(var i in global.banList){
        console.log('_id:'+global.banList[i]);
    }
    var response = {};
    response.result = true;
    res.json(response);
}